<!DOCTYPE html>
<html ng-app="myApp">
	<head lang="en">
		<meta charset="UTF-8">
		<title>测试01</title>		
		
	</head>
	<link rel="stylesheet" type="text/css" href="../css/index.css"/>
	
	<body>	
		<div>
			<p>{{3+5}}</p>
			<p>{{8>1}}</p>
			<p>{{3>5?"我爱你":"我不爱你"}}</p>		
			<p>{{(5+2)*10/2}}</p>	
		</div>
		
		<div>
			<p ng-init="name='郭华锋'" ng-bind="name">{{'不知道啊'}}</p>
			<p>{{name}}</p>
		</div>
		
		<!--<div>
			<ul ng-init="news=['name':'郭华锋';'sex':'男']">
				<li ng-repeat="x in news">
					{{x.name+"  "+x.sex}}
				</li>
			</ul>
		</div>-->
		
		<div>
			<p ng-init="isNumber=false"></p>
			<p ng-if="isNumber">
				会员专区，仅会员可见
			</p>
		</div>
		
		<table ng-init="stu=[
			{name:'guohuafeng01',sex:'男',score:'60'},
			{name:'guohuafeng02',sex:'男',score:40},
			{name:'guohuafeng03',sex:'男',score:80}
		]">
			<thead>
				<tr>
					<th>姓名：</th>
					<th>性别：</th>
					<th>分数：</th>
				</tr>
			</thead>
			
			<tbody>
				<tr ng-repeat="row in stu track by $index" ng-if="row.score>=60">
					<td ng-repeat="x in row ">{{x}}</td>
				</tr>
			</tbody>
		</table>
		
		
		<div ng-controller="myCtrl" class="myCtrl">
			<ul >
				<li ng-repeat="row in stu">
					<span><img ng-src="../images/{{row.url}}"/></span>
					<span>{{"花名：  "+row.name}}</span>
					<span>{{row.price+"   元"}}</span>					
				</li>
				<button ng-click="loadmore()">加载更多</button>
			</ul>
			
		</div>
		
		
		
	</body>
	<script src="../AngularJS-1.4.1/js/angular.js"></script>
	
	<script>
//		声明一个模块
		var app = angular.module("myApp" , ['ng']);
		
		//生命一个控制器
		app.controller("myCtrl",function($scope){
			$scope.stu=[
				{url:'1.jpg',name:'花01',price:'60'},
				{url:'1.jpg',name:'花01',price:'60'},
				{url:'2.jpg',name:'花02',price:'40'},
				{url:'3.jpg',name:'花03',price:'80'}
			];
			
			$scope.loadmore=function(){
				$scope.stu.push({url:'2.jpg',name:'花04',price:'180'})
				
			}
			
			
			
		})
		
	</script>
</html>











